from people import People
import threading
import time
import sys

flag = True


# 控制时间
def countTime():
    statTime = time.time()
    endTime = 1*10 + statTime
    while True:
        runTime = time.time()
        if int(runTime) >= int(endTime):
            global flag
            flag = False
            sys.exit()


def main():
    t1 = threading.Thread(target=countTime)
    t1.start()

    people = People()
    global flag
    while flag:
        people.startGame()
    print("时间到！游戏结束")
    people.getWeight()


if __name__ == "__main__":
    main()

